package com.jia.train.member;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
// 如果当前类被放到其他包下 就要手动指定要扫描的路径
@ComponentScan("com.jia.train")
@MapperScan("com.jia.train.member.mapper") // 开启 Seata 数据源代理 会失效
@EnableTransactionManagement
public class TrainMemberApplication {

    private static final Logger logger = LoggerFactory.getLogger(TrainMemberApplication.class);

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(TrainMemberApplication.class);
        ConfigurableEnvironment env = app.run(args).getEnvironment();
        logger.info("启动成功。。。。");
        logger.info("地址：http://127.0.0.1:{}{}", env.getProperty("server.port"), env.getProperty("server.servlet.context-path"));
    }

}
